# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=imlib2
pkgver=1.12.1
pkgrel=0
pkgdesc="Image manipulation library"
url="https://sourceforge.net/projects/enlightenment/"
arch="all"
license="Imlib2"
subpackages="$pkgname-dev"
depends_dev="freetype-dev libxext-dev libsm-dev"
makedepends="
	$depends_dev
	tiff-dev
	bzip2-dev
	giflib-dev
	libid3tag-dev
	libjpeg-turbo-dev
	libpng-dev
	libwebp-dev
	zlib-dev
	"
source="https://downloads.sourceforge.net/enlightenment/imlib2-$pkgver.tar.gz"

build() {
	CFLAGS="$CFLAGS -flto=auto" \
	CXXFLAGS="$CXXFLAGS -flto=auto" \
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc/imlib2 \
		--x-libraries=/usr/lib \
		--disable-static \
		--enable-visibility-hiding \
		--with-x \
		--with-bzip2 \
		--with-gif \
		--with-id3 \
		--with-jpeg \
		--with-png \
		--with-tiff \
		--with-webp \
		--with-zlib
	make
}

check() {
	make check
}

package() {
	make DESTDIR=$pkgdir install
}

sha512sums="
4b6d5594532f5bdf8ab21a76ff1dcc16286a6c8952d9ff83dda3730bc487a992cf9b7f0063b22fb901472e50267d8a539b7e628f4cbcffe7e4bc0f3e39a83886  imlib2-1.12.1.tar.gz
"
